package com.aistar.controller;

import com.aistar.util.RSAUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PublicController {
    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/login")
    public ModelAndView login() {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("customer/login");
        mav.addObject("publicKey", RSAUtil.getPublicKeyStr());
        return mav;
    }

    @RequestMapping("/register")
    public ModelAndView register() {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("customer/register");
        mav.addObject("publicKey", RSAUtil.getPublicKeyStr());
        return mav;
    }

    @RequestMapping("/competitionPage")
    public String contest() {
        return "contest/competitionPage";
    }

}
